home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1997 August / Walnut Creek CDROM.7z / VOL_400 / 446_01 / DOC / FDMSTART / EX7 / CONSLAW.H < prev    next >
Encoding:
C/C++ Source or Header  |  1996-04-18  |  1.6 KB  |  46 lines

  1. #ifndef ConsLaw_h_IS_INCLUDED
  2. #define ConsLaw_h_IS_INCLUDED
  3. #include <FieldFD.h>
  4. #include <TimePrm.h>
  5. #include <FieldFunc.h>
  6. #include <schemes.h>    // for size of Handle(HCLSchemes)
  7. #include <func.h>       // initial conditions and flux functions
  8. class MenuSystem;
  9.  
  10. class ConsLaw
  11. {
  12. public:
  13.   Handle(GridLattice) grid;       // lattice grid (here: 1D grid)
  14.   Handle(FieldFD) u;              // solution at time step n+1
  15.   Handle(FieldFD) u_prev;         // solution at time step n
  16.   Handle(FieldFD) p;              // coefficient in the equation
  17.   real            p_value;        // type of mean value of p-field
  18.   TimePrm         tip;            // time integration parameters (delta t etc.)
  19.   SetOfNo(real) time_points_for_plot; // time points for making plots
  20.   CurvPlotFile       file;        // for plotting results
  21.   String             scheme_tp;   // (class) name of scheme
  22.   Handle(HCLSchemes) scheme;      // numerical scheme (functor)
  23.   String             flux_tp;     // (class) name of flux functor
  24.   Handle(FluxFunc)   flux;        // flux function (functor)
  25.   String             u0_tp;       // (class) name of u0 functor
  26.   Handle(FieldFunc)  u0;          // initial function (functor)
  27.   real               uL;          // u(0,t) boundary condition
  28.  
  29.   ConsLaw ();
  30.  ~ConsLaw () {}
  31.  
  32.   void solveProblem ();
  33.   void define (MenuSystem& menu, int level = MAIN);
  34.   void scan   (MenuSystem& menu);
  35.   void adm    (MenuSystem& menu);
  36.   BooLean ok () const;
  37.  
  38. protected:
  39.   void setIC ();
  40.   void timeLoop ();
  41.   void solveAtThisTimeLevel ();
  42.   void saveResults ();
  43.   void updateDataStructures ();
  44. };
  45. #endif
  46.